package com.msb.stock.exception;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.msb.stock.util.Result;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CommonException {
    public static Result fallback(Integer id, Throwable e){
        log.error("出现业务异常");
        return Result.error(-1,"===业务异常==");
    }

    public static Result handleException(Integer id, BlockException e){
        log.error("触发限流机制");
        return Result.error(-2,"====触发限流机制==");
    }
}